// 权限配置
import router from "@/router/index";
const AllRouters = [
    {
        id: "1",
        name: "home",
        path: "home",
        component: () => import("@/views/Home/home.vue")
    },
    {
        id: "2-1",
        name: "Banner",
        path: "Banner",
        component: () => import("@/views/Banner/BannerList.vue")
    },
    {
        id: "3-1",
        name: "Operators",
        path: "Operators",
        component: () => import("@/views/Operators/Operators.vue")
    },
    {
        id: "4-5",
        name: "productlist",
        path: "productlist",
        component: () => import("@/views/product/productlist.vue")
    },
    {
        id: "4-1",
        name: "productmiaosha",
        path: "productmiaosha",
        component: () => import("@/views/product/productmiaosha.vue")
    },
    {
        id: "4-2",
        name: "recommendation",
        path: "recommendation",
        component: () => import("@/views/product/recommendation.vue")
    },
    {
        id: "4-3",
        name: "screen",
        path: "screen",
        component: () => import("@/views/product/screen.vue")
    },
    {
        id: "4-4",
        name: "classification",
        path: "classification",
        component: () => import("@/views/product/classification.vue")
    },
    {
        id: "5",
        name: "atlas",
        path: "atlas",
        component: () => import("@/views/atlas/atlas.vue")
    },
    {
        id: "6-1",
        name: "eatch",
        path: "eatch",
        component: () => import("@/views/eatch/eatch.vue")
    },
    {
        id: "6-2",
        name: "eatch2",
        path: "eatch2",
        component: () => import("@/views/eatch/1111.vue")
    },
    {
        id: "7-1",
        name: "order",
        path: "order",
        component: () => import("@/views/order/order.vue")
    },
    {
        id: "2-2",
        name: "AddBanner",
        path: "AddBanner",
        component: () => import("@/views/Banner/AddBanner.vue")
    },
    {
        id: "3-2",
        name: "addOperators",
        path: "addOperators",
        component: () => import("@/views/Operators/AddOperators.vue")
    }
]


export const getCurrentRouters = () => {
    const checkedkeys = localStorage.getItem("checkedkeys");
    const CurrRoutes = []
    AllRouters.forEach((item) => {
        if (checkedkeys.includes(item.id)) {
            CurrRoutes.push({ ...item });
            router.addRoute("Home",item)
        }
      });
}